/* 
 * File:   MotionDetector.h
 * Author: root
 *
 * Created on October 29, 2015, 12:55 AM
 */

#ifndef MOTIONDETECTOR_H
#define	MOTIONDETECTOR_H

#include "RawData.h"
#include "Buffer.h"


typedef unsigned int uint32;
class MotionDetector {
public:
    MotionDetector();
    MotionDetector(const MotionDetector& orig);
    MotionDetector* getInstance();
    virtual ~MotionDetector();
    void release();
    uint32 get();
    uint32 update(const RawData *paraRaw);
    uint32 update(uint32 time, double diff);
    bool checkVariance(const RawData *paraRawA, const RawData *paraRawB);
    
    int motion;
    int time; 
    int runTime; 
    Buffer<RawData, 4> rawBuffer;

private:
    static MotionDetector* instance;

};

#endif	/* MOTIONDETECTOR_H */

